package com.ruoyi.project.syl_DZ.D.OutpatientPatient.controller;

import java.util.List;

import com.ruoyi.project.syl_DZ.D.OutpatientPatient.domain.OutpatientRegisterGHD;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.framework.aspectj.lang.annotation.Log;
import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
import com.ruoyi.framework.web.controller.BaseController;
import com.ruoyi.framework.web.domain.AjaxResult;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.framework.web.page.TableDataInfo;
import com.ruoyi.project.syl_DZ.D.OutpatientPatient.service.IOutpatientPatientServiceDxy ;

/**
 * 【请填写功能名称】Controller
 *
 * @author ruoyi
 * @date 2021-07-17
 */
@RestController
@RequestMapping("/system/register")
public class OutpatientRegisterGHDController extends BaseController
{
    @Autowired
    private IOutpatientPatientServiceDxy outpatientRegisterService;

    /**
     * 新增【请填写功能名称】
     */
    @PreAuthorize("@ss.hasPermi('system:registerghd:add')")
    @Log(title = "新增挂号单", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add2(@RequestBody OutpatientRegisterGHD outpatientRegister)
    {
        outpatientRegister.setRegisterCost(outpatientRegisterService.selectregisterCost(outpatientRegister.getRegisterType()));
        return toAjax(outpatientRegisterService.insertOutpatientRegister(outpatientRegister));
    }
}
